Skip to content

Latest commit

 

History

History
 
 

10 QPainter Python example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

QPainter Python example

This example application demonstrates how you can use QPainter to perform custom rendering in a widget. It turns the text editor from example 7 into an action shooter: When you click inside the editor with the mouse, bullet holes appear.

QPainter Python Example

The crucial steps of this example are to override mousePressEvent(...) to handle the user's clicks, and paintEvent(...) to draw the bullets. See the top of main.py for how these features work in detail.

To run this example yourself, please follow these instructions.